package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.firefightingiot;
import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author Yang
 * LED屏服务
 */
@Service
@Slf4j
public class LEDScreenService extends BaseService {

    /**
     * @Author YangYu
     * @Description 发布文字xml
     * @Date Created in 14:34 2021/9/17
     * @Param [jsonParam]
     */

    public RespEntity publishTextXML(JSONObject jsonParam){
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"publishTextXML","LED");
    }
    /**
     * 屏幕截图
     * @param
     * @throws
     */
    public RespEntity screenshot(JSONObject jsonParam){
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"screenshot","LED");
    }

    /**
     * @Author YangYu
     * @Description 播放节目
     * @Date Created in 9:31 2021/9/18
     * @Param [jsonParam]
     */

    public RespEntity play(JSONObject jsonParam){
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"play","LED");
    }
    /**
     * @Author YangYu
     * @Description 停止播放
     * @Date Created in 14:34 2021/9/16
     * @Param [jsonParam]
     */

    public RespEntity stopPlay(JSONObject jsonParam){
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"stopPlay","LED");
    }

    /**
     * 发布视频
     * @param
     * @throws
     */
    public RespEntity publishVideo(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"publishVideo","LED");
    }

    /**
     * 发布视频
     * @param
     * @throws
     */
    public RespEntity publishPicture(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"publishPicture","LED");
    }

    /**
     * 查询上传视频的文件名
     * @param
     * @throws
     */
    public RespEntity getLedUploadFileList(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"getLedUploadFileList","LED");
    }

    /**
     * @Author YangYu
     * @Description  删除文件
     * @Date Created in 10:54 2021/11/10
     * @Param [jsonParam]
     */

    public RespEntity delFile(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"delFile","LED");
    }
}
